<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<html>
<head>
<script type="text/javascript">
var faceStatusJson;  
$(document).ready(function () {         
	
})

function photo_addphoto(){
	$(".photo_fitem").append("<br/><label>照片:</label>  <input type='file' name='photo' multiple='multiple'/>");
}

/**
 * 保存页面数据
 */
function photo_saveface() {
	$('#photo-face-fm').form('submit', {
		
			url: 'rest/face/uploadsave.do?name=${name}',
	        onSubmit:function(){
	        	//判断photo是否为空
	        	var photoVal=$('#photo').val();
	        	
	        	if(photoVal==null||photoVal==""){
	        		var spans= document.getElementById("massage")
	        		spans.style="display:inline-block;color:red"
	        		return false;
	        	} 
	        	return true;
	        },
	        success:function (data){
	        	parent.showCenter('person/gofaceto.do?name=${name}');
	        }   
	   });
} 
/**
 * 返回页面
 */
function back(){
	$.get('person/gofaceto.do?name=${name}', {}, function(data){
		$("#center").empty();
        $("#center").html(data);
        $.parser.parse($("#center"));
    });
}
	
</script>
</head>
<body>

	<div class="linkbar">
		<a>人员管理  /</a><a> 人脸库管理</a>/<a> 人脸库录入</a>
	</div>
	<div id="face-add" buttons="#face-add-buttons">
		<form id="photo-face-fm" method="post" novalidate
			enctype="multipart/form-data">
			<div class="fitem">
				<label>姓名:</label>
				<input style="border: 0px;outline:none;cursor: pointer;" type="text" readonly="readonly" value='${name }' id="name" name="name"/>
			</div>
			<br>
			<div class="photo_fitem">
				<label>照片:</label> <input type="file" name="photo" id="photo"
					multiple="multiple" />
			</div>

		</form>
	</div>
	<div id="dlg-buttons">
	
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok"
			onclick="photo_addphoto()">添加照片
			</button> <a href="#" class="easyui-linkbutton" iconCls="icon-ok"
			onclick="photo_saveface()">保存</a>
			
			 <a href="#"
			class="easyui-linkbutton" iconCls="icon-cancel"
			onclick="back()">返回</a>
			<span style="display:none" id="massage">请选择上传照片!!!</span>
	</div>


</body>
</html>
</html>